package cn.theten52.demo.patterns.design.structure.proxy.dynamic;

import java.lang.reflect.InvocationHandler;

/**
 * 动态代理
 *
 * @author wangjin
 * @date 2021/1/4
 */
public abstract class AbstractHandler implements InvocationHandler {

    protected Object target;

    public InvocationHandler set(Object target) {
        if (target == null) {
            throw new NullPointerException("target");
        }

        this.target = target;
        return this;
    }

}
